#!/usr/bin/perl

use Modern::Perl;
use Test::More tests => 8;
use File::Slurp;
use Log::Log4perl qw( :easy );

require AEF::AEFReader;
require AEF::DependencyGrabber;

Log::Log4perl->easy_init($INFO);

my $files = {
	ConsoleApp => [ "Console Classes" ], 
	Dll => [], 
	Library => [], 
	TerminalApp => [ "Terminal Lite" ]
};
for my $lib (keys %$files)
{
	my @deps = @{$files->{$lib}};
	my $file = "./t/AEF_test_files/$lib.AEF";
	my $data = read_file($file, binmode => ':raw');

	my $processor = AEF::DependencyGrabber->new();
	my $aef = AEF::AEFReader->new(processor => $processor);
	$aef->ReadAEF($data);
	is($processor->AppName, $lib, "Checking AppName is $lib");
	is_deeply($processor->Libraries, \@deps, "Checking dependencies match");
}


